/*
 * Copyright (C) 2011 Drogolov Roman Olegovich <drull@drull.org.ru>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, see <http://www.gnu.org/licenses/>
 *
 */

#ifndef __QT_NOTIFY_DAEMON_NOTIFY_AREA_H__
#define __QT_NOTIFY_DAEMON_NOTIFY_AREA_H__

#include <vector>

#include <QObject> // QObject, Q_OBJECT
#include <QString>
#include <QStringList>
#include <QVariantMap>
#include <QPoint>

class Message;
class NotifyWidget;
class QMyDBusAbstractAdaptor;
class QSystemTrayIcon; //alex

class NotifyArea : public QObject
{
    Q_OBJECT
public:
    NotifyArea(char *configPath, bool debug);
    void ReReadConfig();

    int addMessage(QString appName, unsigned id, QString icon, QString summary, QString body, QStringList actions, QVariantMap hints, int timeout);

    QString getUrgencyTag(unsigned i) const { return urgencyTag[i]; }

private: 
    std::vector<Message*> messageStack;
    std::vector<Message*> notificationStack;

    NotifyWidget *messageWidget;
    NotifyWidget *notificationWidget;
    QSystemTrayIcon *trayIcon; //alex
    unsigned int index;
    int maxIconSize;
    std::string config;
    bool debugMode;

    bool convertSpecialSymbols;
    QString urgencyTag[4];

    QString readConfigString(QString param);
    QPoint getWidgetPosition(const char *widgetName, QSize widgetSize);
};

#endif
